//
//  CGRegistTextView.m
//  SchoolClient
//
//  Created by mac on 15/11/16.
//  Copyright © 2015年 mac. All rights reserved.


#import "CGRegistTextView.h"

@implementation CGRegistTextView

-(instancetype)initWithFrame:(CGRect)frame andImageName:(NSString *)imageName{
    if (self = [super initWithFrame:frame]) {
        
        UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
        imageView.image = [UIImage imageNamed:@"login_input_phone_bg"];
        [self addSubview:imageView];
        
        
        self.iconImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 12, 20, 20)];
        self.iconImageView.image = [UIImage imageNamed:imageName];
        [self addSubview:self.iconImageView];
        
        CGRect aFrame = CGRectMake(40, 5, self.frame.size.width-40-10 , 34);
        self.textField = [[UITextField alloc]initWithFrame:aFrame];
        self.textField.clearButtonMode = UITextFieldViewModeAlways;
        self.textField.font = [UIFont systemFontOfSize:15];
        [self addSubview:self.textField];
        
    }
    return self;
}

@end
